Counting and Generating Terms in the Binary Lambda Calculus (Extended version)
نویسندگان
چکیده
In a paper entitled Binary lambda calculus and combinatory logic, John Tromp presents a simple way of encoding lambda calculus terms as binary sequences. In what follows, we study the numbers of binary strings of a given size that represent lambda terms and derive results from their generating functions, especially that the number of terms of size n grows roughly like 1.963447954 . . .. In a second part we use this approach to generate random lambda terms using Boltzmann samplers.
منابع مشابه
Counting Terms in the Binary Lambda Calculus
In a paper entitled Binary lambda calculus and combinatory logic, John Tromp presents a simple way of encoding lambda calculus terms as binary sequences. In what follows, we study the numbers of binary strings of a given size that represent lambda terms and derive results from their generating functions, especially that the number of terms of size n grows roughly like 1.963447954n.
متن کاملCounting and generating lambda terms
Lambda calculus is the basis of functional programming and higher order proof assistants. However, little is known about combinatorial properties of lambda terms, in particular, about their asymptotic distribution and random generation. This paper tries to answer questions like: How many terms of a given size are there? What is a “typical” structure of a simply typable term? Despite their osten...
متن کاملCounting Environments and Closures
Environments and closures are two of the main ingredients of evaluation in lambdacalculus. A closure is a pair consisting of a lambda-term and an environment, whereas an environment is a list of lambda-terms assigned to free variables. In this paper we investigate some dynamic aspects of evaluation in lambda-calculus considering the quantitative, combinatorial properties of environments and clo...
متن کاملA Natural Counting of Lambda Terms
We study the sequences of numbers corresponding to lambda terms of given sizes, where the size is this of lambda terms with de Bruijn indices in a very natural model where all the operators have size 1. For plain lambda terms, the sequence corresponds to two families of binary trees for which we exhibit bijections. We study also the distribution of normal forms, head normal forms and strongly n...
متن کاملEnumeration of Generalized BCI Lambda-terms
We investigate the asymptotic number of elements of size n in a particular class of closed lambda-terms (so-called BCI(p)-terms) which are generalizations of lambdaterms related to axiom systems of combinatory logic. By deriving a differential equation for the generating function of the counting sequence we obtain a recurrence relation which can be solved asymptotically. We derive differential ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- J. Funct. Program.
دوره 25 شماره
صفحات -
تاریخ انتشار 2015